/*
 * @Description: 
 * @Version: 1.0
 * @Author: tao
 * @Date: 2021-01-20 11:59:16
 * @LastEditors: tao
 * @LastEditTime: 2021-04-14 13:51:11
 */
import {
  request,
  IP
} from './request'

/**
 * @description: 下载二进制文件
 * @return {*}
 * @author: tao
 */
export function downloadFile() {
  let url = IP + "/user/teaTemplate"
  console.log(url)
  return request({
    url: url.replace(IP, ""),
    responseType: 'blob'
  })
}

export function uploadFile(data) {
  return request({
    url: `/user/teaExcelIn`,
    method: 'post',
    data
  })
}

export function getDataByPageAndSize(page = 1, size = 10) {
  return request({
    url: `/user/teaList`,
    params: {
      page,
      size
    }
  })
}

export function searchById(params) {
  return request({
    url: `/user/teaFind`,
    params
  })
}

export function editData(data) {
  return request({
    url: `/user/teaEdit`,
    method: 'post',
    data
  })
}

export function deleteById(id) {
  return request({
    url: `/user/teaDel?id=${id}`,
  })
}

export function appendData(data) {
  return request({
    url: `/user/teaAdd`,
    method: 'post',
    data
  })
}

export function initPassword(id) {
  return request({
    url: `/user/userPass?id=${id}`,
  })
}